while True:
    num = int(input("请输入密码"))
    if num == 123456:
        print("欢迎进入")
        break
    elif num != 123456:
        print("错误！还有两次机会")
        num = int(input("请输入密码"))
        if num == 123456:
            print("欢迎进入")
            break
        else:
            print("错误！还有一次机会")
            num = int(input("请输入密码"))
            if num == 123456:
                print("欢迎进入")
                break
            else:
                print("错误！此卡已锁定")
                break
